﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assets.Scripts.Tcp
{
    public interface IBlockBuffer<T>
    {
        T[] Buffer { get; }
        int Size { get; }
        int ReadPosition { get; }
        int WritePosition { get; }

        void MoveReadPositionTo(int index);
        void MoveReadPostion(int length);
        void MoveWritePosition(int length);
        void MoveWritePostionTo(int index);
        T[] Read(int length);
        void Read(T[] destinationArray, int destinationIndex, int length);
        void ResetIndex();
        void Write(T[] sourceArray);
        void Write(T[] sourceArray, int sourceIndex, int length);
        void Dispose();
    }
}
